# Contributor:  Liam Timms <timms5000@gmail.com>
# Contributor: mark.blakeney at bullet-systems dot net

pkgname=python-looseversion
_name=${pkgname#python-}
pkgver=1.2.0
pkgrel=2
pkgdesc="Version numbering for anarchists and software realists"
arch=('any')
url='https://github.com/effigies/looseversion'
license=('PSFL2')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-flit' 'python-hatchling')
checkdepends=('python-pytest')
source=("${_name}-${pkgver}.tar.gz::https://github.com/effigies/${_name}/archive/${pkgver}.tar.gz")
sha256sums=('7f030c7ddb3f188fe607e5bbe26069eb11bb93d77c6c58a025184178743178b5')

build() {
    cd "$_name-$pkgver"
    python -m build --wheel --no-isolation
}

check(){
    cd "$_name-$pkgver"
    PYTHONPATH=src pytest -v tests.py
}

package() {
    cd "$_name-$pkgver"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}

